// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

/**
 * Enum for speed units.
 */
enum class FWorldSpeedUnit
{
	MPS,
	MPH,
	KMPH
};

inline FWorldSpeedUnit FWorldSpeedUnitFromJson(const json& j)
{
	if (j == "mps")		return FWorldSpeedUnit::MPS;
	if (j == "mph")		return FWorldSpeedUnit::MPH;
	if (j == "kmph")	return FWorldSpeedUnit::KMPH;
	return FWorldSpeedUnit::MPS;
}

inline json FWorldSpeedUnitToJson(FWorldSpeedUnit p)
{
	if (p == FWorldSpeedUnit::MPS)	return "mps";
	if (p == FWorldSpeedUnit::MPH)	return "mph";
	if (p == FWorldSpeedUnit::KMPH)	return "kmph";
	return "mps";
}

inline void from_json(const json& j, FWorldSpeedUnit& p)
{
	p = FWorldSpeedUnitFromJson(j);
}

inline void to_json(json& j, const FWorldSpeedUnit& p)
{
	j = FWorldSpeedUnitToJson(p);
}
